#ifndef __IOT_String_H_
#define __IOT_String_H_


char *str_replace(char const *const original,
                 char const *const pattern, char const *const replacement);

void unCharToStr(char *str, unsigned char *unChar, int ucLen);

void strTounChar(char *str, unsigned char *unChar);
 

// 十六进制数转换为十进制数 
long hexToDecExt(char *source);
 
// 返回ch字符在sign数组中的序号 
int getIndexOfSigns(char ch);

unsigned char char_to_hex2(unsigned char chr);

unsigned char hex_to_char2(unsigned char hex);

// 字符串化成十六进制数组
int StringToBuff(char *str, unsigned char *OutputBuff);

// 十六进制数组转化成字符串
int ArrayToStr(unsigned char *Buff, unsigned int BuffLen, char *OutputStr);

// 长整数转为 4 字节的 buff 数组
int IntToBuff4(long data, unsigned char *buff);

// 长整数转为 2 字节的 buff 数组
int IntToBuff2(long data, unsigned char *buff);

// 16进制转 整数
long int HexArrayToDec(unsigned char *hexarray, int len);

// 截取字符c之前(含c)的子串，返回dest
void jsonTrimEnd(char *src, int c, char *dest);

#endif //__IOT_String_H_